package com.cn.zengzeng.spbzengzeng.test;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;

import java.util.*;

/**
 *
 * @Author: ZhangZengZeng
 * @Date: 2022/10/4 12:55
 */
@Slf4j
public class Demo4 {

    private static final Map<String,String> SIX_MAP ;
    private static final Map<String,String> MAP ;
    private static final Map<String,String> MAP1 ;
    private static final Map<String,String> MAP2 ;

    public static void main (String[] args) {
        log.info("大小:{}",MAP.size());
        Map<String, String> hashMap = new HashMap<>();
/*        Set<String> strings = MAP.keySet();
        Set<String> strings1 = MAP.keySet();
        for(String s : strings) {
            for(String s1 : strings1) {
                hashMap.put(s+","+s1,"");
            }
        }
        log.info(hashMap.toString());*/

        String str ="䷀,䷁,䷂,䷃,䷄,䷅,䷆,䷇,䷈,䷉,䷊,䷋,䷌,䷍,䷎,䷏,䷐,䷑,䷒,䷓,䷔,䷕,䷖,䷗,䷘,䷙,䷚,䷛,䷜,䷝,䷞,䷟,䷠,䷡,䷢,䷣,䷤,䷥,䷦,䷧,䷨,䷩,䷪,䷫,䷬,䷭,䷮,䷯,䷰,䷱,䷲,䷳,䷴,䷵,䷶,䷷,䷸,䷹,䷺,䷻,䷼,䷽,䷾,䷿";
        String doc="乾为天,坤为地,水雷屯,山水蒙,水天需,天水讼,地水师,水地比,风天小畜,天泽履,地天泰,天地否,天火同人,火天大有,地山谦,雷地豫,泽雷随,山风蛊,地泽临,风地观,火雷噬嗑,山火贲,山地剥,地雷复,天雷无妄,山天大畜,山雷颐,泽风大过,坎为水,离为火," +
                "泽山咸,雷风恒,天山遁,雷天大壮,火地晋,地火明夷,风火家人,火泽睽,水山蹇,雷水解,山泽损,风雷益,泽天夬,天风姤,泽地萃,地风升,泽水困,水风井,泽火革,火风鼎,震为雷,艮为山,风山渐,雷泽归妹,雷火丰,火山旅,巽为风,兑为泽,风水涣,水泽节,风泽中孚,雷山小过,水火既济,火水未济";
        String[] split = str.split(",");
        List<String> gua = Arrays.asList(split);
        String[] dot = doc.split(",");
        List<String> docs = Arrays.asList(dot);
        for(int i = 0;i < gua.size();i++) {
            hashMap.put(gua.get(i),docs.get(i));
        }
       log.info("64卦卦象:{}",JSON.toJSONString(hashMap));
    }
    static {
        //X 字  O 背
        SIX_MAP = new HashMap<>();
        SIX_MAP.put("OOX","''");
        SIX_MAP.put("OOO","O");
        SIX_MAP.put("XXX","X");
        SIX_MAP.put("XXO","'");

        MAP = new HashMap<>();
        /*
        * 乾（☰）、坎（☵）、艮（☶）、震（☳）、巽（☴）、离（☲）、坤（☷）、兑（☱）
        * 上卦(外挂) ,  下挂(内卦)  左-->右
        *                         上-->下
        * */
        MAP.put("☰","乾");
        MAP.put("☱","兑");
        MAP.put("☲","离");
        MAP.put("☳","震");
        MAP.put("☴","巽");
        MAP.put("☵","坎");
        MAP.put("☶","艮");
        MAP.put("☷","坤");

        MAP1 = new HashMap<>();
        MAP1.put("䷀","乾为天");
        MAP1.put("䷁","坤为地");
        MAP1.put("䷂","水雷屯");
        MAP1.put("䷃","山水蒙");
        MAP1.put("䷄","水天需");
        MAP1.put("䷅","天水讼");
        MAP1.put("䷆","地水师");
        MAP1.put("䷇","水地比");
        MAP1.put("䷈","风天小畜");
        MAP1.put("䷉","天泽履");
        MAP1.put("䷊","地天泰");
        MAP1.put("䷋","天地否");
        MAP1.put("䷌","天火同人");
        MAP1.put("䷍","火天大有");
        MAP1.put("䷎","地山谦");
        MAP1.put("䷏","雷地豫");
        MAP1.put("䷐","泽雷随");
        MAP1.put("䷑","山风蛊");
        MAP1.put("䷒","地泽临");
        MAP1.put("䷓","风地观");
        MAP1.put("䷔","火雷噬嗑");
        MAP1.put("䷕","山火贲");
        MAP1.put("䷖","山地剥");
        MAP1.put("䷗","地雷复");
        MAP1.put("䷘","天雷无妄");
        MAP1.put("䷙","山天大畜");
        MAP1.put("䷚","山雷颐");
        MAP1.put("䷛","泽风大过");
        MAP1.put("䷜","坎为水");
        MAP1.put("䷝","离为火");
        MAP1.put("䷞","泽山咸");
        MAP1.put("䷟","雷风恒");
        MAP1.put("䷠","天山遁");
        MAP1.put("䷡","雷天大壮");
        MAP1.put("䷢","火地晋");
        MAP1.put("䷣","地火明夷");
        MAP1.put("䷤","风火家人");
        MAP1.put("䷥","火泽睽");
        MAP1.put("䷦","水山蹇");
        MAP1.put("䷧","雷水解");
        MAP1.put("䷨","山泽损");
        MAP1.put("䷩","风雷益");
        MAP1.put("䷪","泽天夬");
        MAP1.put("䷫","天风姤");
        MAP1.put("䷬","泽地萃");
        MAP1.put("䷭","地风升");
        MAP1.put("䷮","泽水困");
        MAP1.put("䷯","水风井");
        MAP1.put("䷰","泽火革");
        MAP1.put("䷱","火风鼎");
        MAP1.put("䷲","震为雷");
        MAP1.put("䷳","艮为山");
        MAP1.put("䷴","风山渐");
        MAP1.put("䷵","雷泽归妹");
        MAP1.put("䷶","雷火丰");
        MAP1.put("䷷","火山旅");
        MAP1.put("䷸","巽为风");
        MAP1.put("䷹","兑为泽");
        MAP1.put("䷺","风水涣");
        MAP1.put("䷻","水泽节");
        MAP1.put("䷼","风泽中孚");
        MAP1.put("䷽","雷山小过");
        MAP1.put("䷾","水火既济");
        MAP1.put("䷿","火水未济");

        MAP2 = new HashMap<>();
        MAP2.put("☰,☰","乾为天");
    }
}
